package com.yuer.tools.myfileziptools.controller;



import com.yuer.tools.myfileziptools.response.CommonResponse;
import com.yuer.tools.myfileziptools.service.LagouStudentDetailServer;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
* @ClassName PanFileZipController
* @Description 百度云网盘文件相关的信息 前端控制器
* @Author codeGoogler
* @Date 2021-06-27
* @Version 1.0
*/
@Api(value = "LagouStudentDetailController" , tags = "爬取拉勾学情相关的接口")
@RestController
@RequestMapping("/lagouStudy")
public class LagouStudentDetailController {

    @Autowired(required = false)
    private LagouStudentDetailServer lagouStudentDetailServer;


    @ApiOperation(value = "爬取拉勾学情相关",httpMethod = "GET")
    @GetMapping("/parseSutdentDetailRate")
    @ResponseBody
    public CommonResponse parseSutdentDetailRate(  @ApiParam(name = "cookie", value = "自己登录账号的cookie", required = true)  @RequestParam String cookie,
                                                   @ApiParam(name = "courseId", value = "自己要查询的课程id", required = true)@RequestParam  Integer courseId,
                                                   @ApiParam(name = "classId", value = "自己要查询的班级id", required = true)@RequestParam Integer classId,
                                                   @ApiParam(name = "conditionPersonNum", value = "要判断报名课程完成的课程数据，比如大2，表示超过2条就是判断为复购", required = true) @RequestParam Integer conditionPersonNum
                                                   ) {
        return lagouStudentDetailServer.parseSutdentDetailRate(cookie,courseId,classId,conditionPersonNum);
    }
    @ApiOperation(value = "导出数据（爬取拉勾学情相关）",httpMethod = "GET")
    @GetMapping("/exoprt/parseSutdentDetailRate")
    @ResponseBody
    public void parseExportSutdentDetailRate(HttpServletResponse response,
                                             @ApiParam(name = "cookie", value = "自己登录账号的cookie", required = true)  @RequestParam String cookie,
                                             @ApiParam(name = "courseId", value = "自己要查询的课程id", required = true)@RequestParam  Integer courseId,
                                             @ApiParam(name = "classId", value = "自己要查询的班级id", required = true)@RequestParam Integer classId,
                                             @ApiParam(name = "conditionPersonNum", value = "要判断报名课程完成的课程数据，比如大2，表示超过2条就是判断为复购", required = true) @RequestParam Integer conditionPersonNum
    ) {
          lagouStudentDetailServer.parseExportSutdentDetailRate(response,cookie,courseId,classId,conditionPersonNum);
    }
}
